import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:get/get.dart';
import 'package:shop/app/modules/productContent/controllers/product_content_controller.dart';

import '../../../../tools/screenAdapter.dart';

class SecondPageView extends GetView {
  final Function subHeader;
  @override
  ProductContentController controller = Get.find();

  SecondPageView(this.subHeader, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      key: controller.gb2,
      width: ScreenAdapter.width(1080),
      child: Obx(
        () => controller.pcontent.value.sId != null
            ? Column(
                children: [
                  //   详情Tab标题
                  subHeader(),
                  controller.subSelectIndex.value == 1
                      ? Container(
                          width: ScreenAdapter.width(1080),
                          child: Html(
                            data: controller.pcontent.value.content,
                            style: {
                              "body": Style(backgroundColor: Colors.white),
                              "p": Style(fontSize: FontSize.large),
                            },
                          ),
                        )
                      : Container(
                          width: ScreenAdapter.width(1080),
                          child: Html(
                            data: controller.pcontent.value.specs,
                            style: {
                              "body": Style(backgroundColor: Colors.white),
                              "p": Style(fontSize: FontSize.large),
                            },
                          ),
                        ),
                ],
              )
            : Center(child: Container(child: CircularProgressIndicator())),
      ),
    );
  }
}
